<div class="modal-header">
    <h4 class="modal-title">{{office.name}}</h4>
</div>
<div class="modal-body clearfix">
    <div class="row col-xs-12">
        <div class="col-xs-2"></div>
        <div class="col-xs-3">
            <div class="input-group">
                <div class="input-group-addon">分销商</div>
                <ui-select ng-model="page.select_company_code" theme="bootstrap">
                    <ui-select-match placeholder="分销商">
                        {{$select.selected.name}}
                        【{{$select.selected.code}}】
                    </ui-select-match>
                    <ui-select-choices repeat="item.code as item in company_code_list | filter: $select.search">
                        <span ng-bind-html="item.name | highlight: $select.search"></span>
                        【<span ng-bind-html="item.code | highlight: $select.search"></span>】
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>
        <div class="col-xs-1">
            <a class="btn btn-success btn-block" ng-click="add()">添加</a>
        </div>
        <div class="col-xs-6"></div>
    </div>
    <div class="row col-xs-12 mt20">
        <table class="table table-bordered">
            <thead>
                <th class="text-center">机构编号</th>
                <th class="text-center">机构名称</th>
                <th class="text-center">操作</th>
            </thead>
            <tbody>
                <tr ng-repeat="company in selectedCompanyList">
                    <td class="text-center">
                        {{company.down_company_code}}
                    </td>
                    <td class="text-center">
                        {{company.company_name}}
                    </td>
                    <td class="text-center">
                        <a class="btn btn-success btn-xs" ng-if="company.is_stop == '0'" ng-click="changeState($index, '1')">启用</a>
                        <a class="btn btn-danger btn-xs" ng-if="company.is_stop == '1'" ng-click="changeState($index, '0')">停用</a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="modal-footer">
    <button class="btn btn-success" type="button" ng-click="ok()">确定</button>
</div>